package com.onesports.intelligent.k12.polarlight.domain.dto.course;

import com.onesports.framework.kit.common.valid.Decimal;
import com.onesports.framework.kit.common.valid.Length;
import com.onesports.framework.kit.common.valid.NotEmpty;
import com.onesports.framework.kit.common.valid.Regex;
import com.onesports.intelligent.k12.polarlight.security.SecurityUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.annotation.RegEx;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.Pattern;
import java.lang.reflect.Member;
import java.math.BigDecimal;

/**
 * @author Wsy
 **/
@Data
@ApiModel("调价DTO")
public class AdjustPriceDTO {

    @ApiModelProperty(value = "校区id",required = true)
    @NotEmpty(message = "请选择校区")
    private String campusId;

    @ApiModelProperty(value = "课程id",required = true)
    @NotEmpty(message = "请选择课程")
    private String courseId;

    @ApiModelProperty(value = "拼班类型id",required = true)
    @NotEmpty(message = "请选择拼班类型")
    private String guidePriceId;

    @ApiModelProperty(value = "调整价",required = true)
    @NotEmpty(message = "请输入调整价")
    @Regex(expr = "^\\d{0,6}(\\.\\d{0,2})?$", message = "请输入最多六位的非负整数或最多两位小数的数值")
    private BigDecimal adjustPrice;

    @ApiModelProperty(value = "调整原因",required = true)
    @NotEmpty(message = "请输入原因")
    @Length(max = 1000, message = "原因字数不可超过1000")
    private String adjustReason;

    @ApiModelProperty(hidden = true)
    private String organizationId = SecurityUtils.getOrganizationId();
}
